/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package views;

import controllers.Salas;
import javax.swing.JOptionPane;
import models.enums.TipoSala;

/**
 *
 * @author kevin_000
 */
public class AgregarSalas extends javax.swing.JFrame {

    /**
     * Creates new form AgregarSalas
     */
    Salas sala;
    public AgregarSalas() {
        initComponents();
        setSize(1300, 460);
        sala = new Salas();
        setLocationRelativeTo(null);
        cmbTipo.addItem(models.enums.TipoSala.GRANDE);
        cmbTipo.addItem(models.enums.TipoSala.NORMAL);
        cmbTipo.addItem(models.enums.TipoSala.TRESDE);
        cmbTipo.addItem(models.enums.TipoSala.VIP);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtColumnas = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        cmbTipo = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        txtFilas = new javax.swing.JTextField();
        txtNumSala = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Crear Nueva Sala");
        getContentPane().setLayout(null);

        jLabel3.setFont(new java.awt.Font("Rockwell", 3, 48)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("AGREGAR NUEVA SALA");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(30, 20, 560, 50);

        jLabel2.setFont(new java.awt.Font("Rockwell", 1, 30)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Columnas");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(20, 250, 190, 40);
        getContentPane().add(txtColumnas);
        txtColumnas.setBounds(270, 260, 150, 30);

        jLabel4.setFont(new java.awt.Font("Rockwell", 1, 30)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("Numero de Sala");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(20, 100, 240, 40);

        cmbTipo.setFont(new java.awt.Font("Rockwell", 1, 18)); // NOI18N
        getContentPane().add(cmbTipo);
        cmbTipo.setBounds(270, 160, 150, 30);

        jLabel5.setFont(new java.awt.Font("Rockwell", 1, 30)); // NOI18N
        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("Filas");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(20, 200, 190, 40);

        jLabel6.setFont(new java.awt.Font("Rockwell", 1, 30)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("Tipo de Sala");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(20, 150, 190, 40);
        getContentPane().add(txtFilas);
        txtFilas.setBounds(270, 210, 150, 30);
        getContentPane().add(txtNumSala);
        txtNumSala.setBounds(270, 110, 150, 30);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/Boton 21.png"))); // NOI18N
        jButton1.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/Boton 21 Rollover.png"))); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(420, 340, 180, 60);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/Boton 20.png"))); // NOI18N
        jButton3.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/Boton 20 Rollover.png"))); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton3);
        jButton3.setBounds(220, 340, 180, 60);

        jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/2.png"))); // NOI18N
        getContentPane().add(jLabel7);
        jLabel7.setBounds(640, 30, 620, 39);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 620, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 330, Short.MAX_VALUE)
        );

        getContentPane().add(jPanel1);
        jPanel1.setBounds(640, 70, 620, 330);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/FF0325090.jpg"))); // NOI18N
        getContentPane().add(jLabel1);
        jLabel1.setBounds(0, 0, 1310, 630);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        this.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        sala.agregarSala(Integer.parseInt(txtNumSala.getText()), txtFilas.getText(), txtColumnas.getText(), cmbTipo.getSelectedItem().toString());
        JOptionPane.showMessageDialog(rootPane, "Sala agregada con exito");
    }//GEN-LAST:event_jButton3ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(AgregarSalas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(AgregarSalas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(AgregarSalas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(AgregarSalas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new AgregarSalas().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cmbTipo;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField txtColumnas;
    private javax.swing.JTextField txtFilas;
    private javax.swing.JTextField txtNumSala;
    // End of variables declaration//GEN-END:variables
}
